package cn.iocoder.yudao.module.system.api.dict;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.dict.dto.DictTypeRespDTO;
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO;
import cn.iocoder.yudao.module.system.service.dict.DictTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class DictTypeApiImpl implements DictTypeApi {
    @Resource
    private DictTypeService dictTypeService;

    public DictTypeRespDTO getDictType(String type) {
        DictTypeDO dictData = dictTypeService.getDictByType(type);
        return BeanUtils.toBean(dictData, DictTypeRespDTO.class);
    }
}
